<!DOCTYPE html>
<html lang="en">

<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>小力权限</title>
    <meta name="description" content="小力权限">
    <meta name="keywords" content="小力权限">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/login.css">
    <link rel="stylesheet" href="css/BeAlert.css">
    <!-- 引入组件库 -->
    <script type="text/javascript" src="./js/jquery.min.js"></script>
    <script type="text/javascript" src="./js/jq.form.js"></script>
    <script type="text/javascript" src="./js/BeAlert.js"></script>
</head>
<body>
<div class="login-container">
    <div class="loginBox">
        <form class="form-signin" method="post" action="/login.do" accept-charset="utf-8" id="frm-login">
            <div class="title-container">
<!--                <div class="logoInfo clearfix">-->
<!--                    <div class="logo"></div>-->
<!--                </div>-->
                <div class="logoInfo clearfix"><h3>小力权限管理</h3></div>
            </div>

            <div style="display: flex; margin-bottom: 20px;">
                <span class="svg-container">
                  <span class="user"></span>
                </span>
                <input type="text" class="form-control" name="username" id="username" placeholder="请输入用户名" required=""
                       autofocus=""/>
            </div>
            <div style="display: flex;">
                <span class="svg-container" style="margin-top: 5px;">
                  <span class="usernames"></span>
                </span>
                <input type="password" class="form-control" name="password" id="password" placeholder="请输入密码"
                       required=""/>
            </div>
            <label class="checkbox">
                <input type="checkbox" value="remember-me" id="rememberMe" name="rememberMe"> 记住密码
            </label>
            <button class="btn btn-lg btn-primary btn-block" type="submit" id="sub">登录</button>
        </form>
    </div>
</div>
</body>
<script type="text/javascript">
    /*$("#sub").click(function () {
        $("#frm-login").ajaxSubmit(function (data) {
            alert(data.errorMsg);
            return false;
        })
    })*/
    $(function () {
        $("#frm-login").ajaxForm(function (data) {
            if (data.success) {
                window.location.href = "/pages/main.html";
            } else {
                alert(data.errorMsg);
            }
        });
    });
</script>
</html>
